import sys


def solve(w):
    m = max(w)
    ans = []
    for ch in w:
        ans.append(ch)
        if ch == m:
            ans.append("(max)")
    print("".join(ans))


def main():
    for line in sys.stdin.readlines():
        solve(line.strip())


if __name__ == '__main__':
    main()
